package com.google.code.rapid.queue;

import java.util.List;

import com.google.code.rapid.queue.util.RouterKeyUtil;

/**
 * 主题消息，用于客户端消费数据使用
 * 
 * 	Durable (the queue will survive a broker restart)
 *	Exclusive (used by only one connection and the queue will be deleted when that connection closes)
 *	Auto-delete (queue is deleted when last consumer unsubscribes)
 * @author badqiu
 *
 */
public class TopicQueue {
	
	private List<String> routerKeyList;
	private DurableQueue queue;
	
	private String queueName;
	private String remarks; // 备注
	
	private boolean durable;
	private boolean autoDelete; //auto delete queue by timeout
	
	public List<String> getRouterKeyList() {
		return routerKeyList;
	}

	public void setRouterKeyList(List<String> routerKeyList) {
		this.routerKeyList = routerKeyList;
	}

	public boolean matchRouterKey(String routerKeyValue) {
		return RouterKeyUtil.matchRouterKey(routerKeyList, routerKeyValue);
	}

	public DurableQueue getQueue() {
		return queue;
	}
	
	
}
